
// 3. test Eigen write to file
// build: g++ -I/usr/include/eigen3 3.matrix_write.cpp
#include <iostream>
#include <Eigen/Dense>
#include <fstream>

using namespace std;
int main()
{
    std::ofstream file("test.txt");
    if (file.is_open())
    {
        Eigen::MatrixXf m = Eigen::MatrixXf::Random(30,3);
        file << "Here is the matrix m:\n" << m << '\n';
    }
    file.close(); 
}
